/*
 * @Desc: dialog混入
 * @author cheegon
 * @date 6/10/2021  10:45 AM
 **/
export default {
    props: {
        isEdit: {
            type: Boolean,
            default: false
        },
        info: {
            type: Object,
            default: () => ({})
        },
        isShow: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            loading: false,
            isShowPop: this.isShow,
        }
    },
    watch: {
        isShow(val) {
            this.isShowPop = val
            if (val) {
                this.refresh && this.refresh()
            }
        },
        isShowPop(val) {
            this.$emit('update:isShow', val)
        }
    },
    methods: {
        handleClose() {
            this.isShowPop = false
        },
        /**
         * 完成通知
         */
        onComplete() {
            this.$emit("complete")
        },
        handleResetForm() {
            this.formData = {}
            this.$refs.formRef && this.$refs.formRef.resetFields()
        }
    }
}
